package com.ktjiaoyu.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ktjiaoyu.server.domain.pojo.Menu;
import com.ktjiaoyu.server.mapper.MenuMapper;
import com.ktjiaoyu.server.security.LoginUser;
import com.ktjiaoyu.server.service.MenuService;
import com.ktjiaoyu.server.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu>
    implements MenuService{

    @Autowired
    private MenuMapper menuMapper;

    @Override
    public List<Menu> getMenusByAdminId() {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        return menuMapper.getMenusByAdminId(loginUser.getAdmin().getId());
    }
}




